package com.tl.satoken.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tl.satoken.domain.entity.User;
import org.apache.ibatis.annotations.Select;

public interface UserMapper extends BaseMapper<User> {


    /**
     * 根据openid查询用户
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openid}")
    User getByOpenid(String openid);

    /**
     * 根据用户名查询
     */
    User selectByUsername(String username);






    @Select("select user.openid from user where id = #{userId}")
    User getOpenidByUserId(Long userId);
}